<script src="/home/js/jquery.SuperSlide.2.1.1.js"></script>
<script src="/home/js/jquery.slideBox.js"></script>
<div class="banner">
    <div class="flexslider">
        <ul class="slides">
            {{--<li style="background:url(/home/images/pcpic0.jpg) 50% 0 no-repeat;"><a href="" target="_blank"--}}
                                                                                    {{--style="display:block;width:100%;height:100%;"></a>--}}
            {{--</li>--}}
            <li style="background:url(/home/images/pcpic1.jpg) 50% 0 no-repeat;"></li>
            <li style="background:url(/home/images/pcpic2.jpg) 50% 0 no-repeat;"></li>
            <li style="background:url(/home/images/pcpic3.jpg) 50% 0 no-repeat;"></li>
            <li style="background:url(/home/images/pcpic4.jpg) 50% 0 no-repeat;"></li>
        </ul>
        <div class="main" style="position:relative;">

            <div class="apply" style="position:absolute;left:0;top:0;z-index:100;">
                <form action="{{url('apply/fastapply')}}" name="FastForm" id="FastForm" method="post">
                    {!! csrf_field() !!}
                    <input class="input_name inputall" name="name"
                           onblur="if (this.value == '') {this.value = '您的姓名';}"
                           onfocus="if (this.value == '您的姓名') {this.value = '';}" value="您的姓名">
                    <div class="genderbox">
                        <input type="radio" name="sex" value="1" class="genderbox_radio">
                        <p>男</p>
                        <input type="radio" name="sex" value="0" class="genderbox_radio">
                        <p>女</p>
                    </div>

                    <div class="input_box">
                        <input class="input_how inputall" name="fee" type="number" min="1"
                               onblur="if (this.value == '') {this.value = '您的金额';}"
                               onfocus="if (this.value == '您的金额') {this.value = '';}" value="您的金额"/>
                        <p>万元</p>
                    </div>

                    <select class="select inputall" name="time_limit" style="line-height:40px;">
                        <option value="">请选择</option>
                        @foreach($config['time_limit'] as $key=>$val)
                            <option value="{{$key}}">{{$val}}</option>
                        @endforeach
                    </select>

                    <input class="input_phone inputall" name="mobile"
                           onblur="if (this.value == '') {this.value = '您的手机号';}"
                           onfocus="if (this.value == '您的手机号') {this.value = '';}" value="您的手机号"
                           style="line-height:40px;"/>
                    <div class="codebox">
                        <input class="code inputall" name="code"
                               onblur="if (this.value == '') {this.value = '手机验证码';}"
                               onfocus="if (this.value == '手机验证码') {this.value = '';}" value="手机验证码"/>
                        <button type="button" class="codebtn checkcell">获取验证码</button>
                    </div>
                    <button type="button" class="loanbtn subBtn">申请贷款</button>
                </form>
            </div><!--apply-->
        </div>
    </div>
    <script type="text/javascript" src="/home/js/jquery.flexslider-min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('.flexslider').flexslider({
                directionNav: true,
                pauseOnAction: false
            });
        });
    </script>

    <script>
        var smsUrl = "{{url('sms/send')}}";
        $(document).ready(function () {
            var twooptions = {
                success: function (data) {
                    $(".subBtn").attr('disabled', false);
                    console.log(data);
                    layer.msg(data.message);
                    if (data.code == '0000') {
                        setTimeout(function () {
                            window.location.reload();
                        }, 3000);
                    }
                }
            };
            $(".subBtn").click(function () {
                var fm = document.forms['FastForm'];// HTML DOM 通过form 元素的name值获取
                //
                var myreg = /^(((13[0-9]{1})|(17[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
                if (!myreg.test(fm.mobile.value)) {
                    layer.msg('请输入有效的手机号码！');
                    return false;
                }
                if (fm.code.value == '') {
                    layer.msg('请填写验证码');
                    return false;
                }
                if (fm.name.value == '') {
                    layer.msg('请填写姓名');
                    return false;
                }
                if (fm.fee.value == '') {
                    layer.msg('请填写贷款额度');
                    return false;
                }
                if (fm.time_limit.value == '') {
                    layer.msg('请选择贷款期限');
                    return false;
                }
                $(".subBtn").attr('disabled', true);//禁用按钮
                $("#FastForm").ajaxSubmit(twooptions);
            });
        });


    </script>

    <script src="/home/js/sendcode.js"></script>
</div><!--banner-->